home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / ttempnam.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1.1 KB  |  34 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TTempName
  4. //    Include File:    ttempnam.h
  5. //    Purpose:    Provide a class to handle the creation of temporary
  6. //            file names.
  7. //    Remarks/Portability/Dependencies/Restrictions:
  8. //        Nothing but the file name is created.
  9. //        Several TTempName objects created in a row may produce
  10. //            duplicate file names.
  11. //    Revision History:
  12. //        02-15-94    created
  13. #include"ttempnam.h"
  14. #include"tcapture.h"
  15. #include<stdio.h>
  16.  
  17. TTempName::TTempName(const char *cp_TemporaryDir)    {
  18. //    Purpose:    Constructor.
  19. //    Arguments:    cp_TemporaryDir    The directory in which to create the
  20. //                    temporary file.  If NULL, then the
  21. //                    current directory might be used.
  22. //    Return Value:    none
  23. //    Remarks/Portability/Dependencies/Restrictions:
  24. //    Revision History:
  25. //        02-15-94    created
  26.  
  27.     //    Create the temporary file name.
  28.     cp_TempName = (const char *)::tempnam((char *)cp_TemporaryDir, "DLX");
  29.  
  30.     //    If unable to create, print a message.
  31.     if(cp_TempName == NULL)    {
  32.         doslynxmessage("No more temporary files available.");
  33.     }
  34. }